home *** CD-ROM | disk | FTP | other *** search
- /****
- * CObject1Pane.c
- *
- * Pane methods for a typical application.
- *
- * Most applications will want a scrollable window, so this
- * class is based on the class CPanorama. All the methods here
- * would still apply to classes based directly on CPane.
- *
- ****/
-
- #include "CObject1Pane.h"
-
- void CObject1Pane::IObject1Pane(CView *anEnclosure, CBureaucrat *aSupervisor,
- short aWidth, short aHeight,
- short aHEncl, short aVEncl,
- SizingOption aHSizing, SizingOption aVSizing)
- {
- CPanorama::IPanorama(anEnclosure, aSupervisor, aWidth, aHeight,
- aHEncl, aVEncl, aHSizing, aVSizing);
- }
-
- /***
- * Draw
- *
- * In this method, you draw whatever you need to display in
- * your pane. The area parameter gives the portion of the
- * pane that needs to be redrawn. Area is in frame coordinates.
- *
- ***/
-
- void CObject1Pane::Draw(Rect *area)
-
- { /* draw your stuff */
- /* I put my stuff in a seperate function to cut compilation time. */
-
- DrawMyStuff();
-
- }
-
- /***
- * DoClick
- *
- * The mouse went down in the pane.
- * In this method you do whatever is appropriate for your
- * application. HitPt is given in frame coordinates. The other
- * parameters, modiferKeys and when, are taken from the event
- * record.
- *
- * If you want to implement mouse tracking, this is the method
- * to do it in. You need to create a subclass of CMouseTask and
- * pass it in a TrackMouse() message to the pane.
- *
- ***/
-
- void CObject1Pane::DoClick(Point hitPt, short modifierKeys, long when)
-
- {
- /* what happens when the mouse goes down */
- }
-
-
- /***
- * HitSamePart
- *
- * Test whether pointA and pointB are in the same part.
- * "The same part" means different things for different applications.
- * In the default method, "the same part" means "in the same pane."
- * If you want a different behavior, override this method. For instance,
- * two points might be in the same part if they're within n pixels
- * from each other.
- *
- * PointA and pointB are both in frame coordinates.
- *
- ***/
-
- Boolean CObject1Pane::HitSamePart(Point pointA, Point pointB)
-
- {
- return inherited::HitSamePart(pointA, pointB);
- }
-
-
- /***
- * AdjustCursor
- *
- * If you want the cursor to have a different shape in your pane,
- * do it in this method. If you want a different cursor for different
- * parts of the same pane, you'll need to change the mouseRgn like this:
- * 1. Create a region for the "special area" of your pane.
- * 2. Convert this region to global coordinates
- * 3. Set the mouseRgn to the intersection of this region
- * and the original mouseRgn: SectRgn(mouseRgn, myRgn, mouseRgn);
- *
- * The default method just sets the cursor to the arrow. If this is fine
- * for you, don't override this method.
- *
- ***/
-
- void CObject1Pane::AdjustCursor(Point where, RgnHandle mouseRgn)
-
- {
- inherited::AdjustCursor(where, mouseRgn);
- }
-
-
- /***
- * ScrollToSelection
- *
- * If your pane is based on a Panorama (as this example is), you might
- * want to define what it means to have a selection and what it means to
- * scroll to that selection.
- *
- ***/
-
- void CObject1Pane::ScrollToSelection(void)
-
- {
- /* scroll to the selection */
- }
-